package com.zaofan.service;

import com.zaofan.bean.OrderLog;
import com.zaofan.dao.OrderLogDao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class OrderLogService {
	private OrderLogDao orderLogDao = new OrderLogDao();

	public void delete(OrderLog orderLog) {
		orderLogDao.del(orderLog);
	}

	public void add(OrderLog orderLog) {
		orderLogDao.add(orderLog);
	}

	public void update(OrderLog orderLog) {
		orderLogDao.update(orderLog);
	}
	public List<OrderLog> findAll(Map<String, Object> params) {
		List<OrderLog> data = orderLogDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return orderLogDao.count(params);
	}

	public OrderLog findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return orderLogDao.findOne(params);
	}

}
